package com.wyl.pmd.rule.performance;

import java.util.Arrays;

public class AvoidArrayLoops {

	
	public static void main(String[] args) {
		
		int[] a = new int[10];
		
		// bad
        int[] b = new int[10];
        for (int i=0;i<10;i++) {
            b[i]=a[i];
        }
        
        // good
        int[] c = new int[10];
		System.arraycopy(a, 0, c, 0, 10);
		int[] d = Arrays.copyOfRange(a, 0, 10);
		
	}
	
	
}
